// pages/person/constellation/constellation.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    array: ['水瓶座【1.20-2.18】', '双鱼座【2.19-3.20】', '白羊座【3.21-4.19】',
      '金牛座【4.20-5.20】', '双子座【5.21-6.21】', '巨蟹座【6.22-7.22】',
      '狮子座【7.23-8.22】', '处女座【8.23-9.22】', '天秤座【9.23-1023】',
      '天蝎座【10.24-11.22】', '射手座【11.23-12.21】', '摩羯座【12.22-1.19】'],
    index: 0,
    xz: []

  },
  onLoad: function (options) {

  },
  bindPickerChange: function (e) {

    console.log('picker发送选择改变，携带值为', e.detail.value)
  },

  formSubmit: function (e) {
    // console.log('form发生了submit事件，携带数据为：', e.detail.value)
    // console.log(e);
    var xz = e.detail.value.input;

    //console.log(i);
    this.check(xz);
  },
  check: function (option) {
    var x = option;

    if (x != null) {
      if ("水瓶座" == x || "双鱼座" == x || "白羊座" == x || "金牛座" == x ||
        "双子座" == x || "巨蟹座" == x || "狮子座" == x || "处女座" == x ||
        "天秤座" == x || "天蝎座" == x || "射手座" == x || "摩羯座" == x) {
        wx.navigateTo({
          url: "/pages/news/news?xz="+x
        });
     
      }
      else {
        wx.showToast({
          title: '输入有误',
          icon: "none"
        })
      }
    } else {
      wx.showToast({
        title: '输入有误',
        icon: "none"
      })
    }
  },




  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  }
})